<!DOCTYPE html>
<html>

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>基础知识</title>
	<link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css"" rel="stylesheet">
	<link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
	<link href="https://cdn.bootcdn.net/ajax/libs/animate.css/3.2.3/animate.css" rel="stylesheet">
	<link rel="stylesheet" type="text/css" href="../../static/css/public.css" />
</head>
<body>
	<!--右边内容-->
	<div id="app" class="main animated fadeInRight">
		<div class="shadow">
			<div>
				<h3>循环语句</h3>
			</div>
			<div>
				<h4>while</h4>
				<pre>
	while (变量<=结束值) { 需执行的代码 } 
					
	while (exp) {	//statements;} 
				</pre>
			</div>
			<div>
				<h4>do...while</h4>
				<p>语句 特点:至少执行一次代码,再判断是否进行下一次循环</p>
				<pre>
	do { 需执行的代码 } while (变量<=结束值)				
	var j=0;
	var S=0;
	do{
		j++; 
		S=S+j;
	}while(j<10)
	console.log("S="+S);=>55
				</pre>
			</div>
			<div>
				<h4>for 循环语句</h4>
				<p>语句 特点:至少执行一次代码,再判断是否进行下一次循环</p>
				<pre>
	for (变量=开始值;变量<=结束值;变量=变量+步进值) { 	需执行的代码 	} 	
				
	for(var count = 1; count < 11; count++){		
		alert(count);	
	}
				</pre>
			</div>
			<div>
				<h4>break、continue</h4>
				<p>break 语句可以立即退出循环;	continue 语句只是退出当前循环;</p>
				<pre>
	var n = 0;	
	for(var i = 1; i < 10; i++){		
		if(i == 4){		    
			continue;		
		}		
		n++;	
	}	
	alert(n);
				</pre>
			</div>
		</div>
	</div>
	<!--页面加载进度条-->
	<script src="https://cdn.bootcdn.net/ajax/libs/pace/0.5.0/pace.min.js"></script>
</body>

</html>